package org.xiaoyu.rpc.seralization.support;

import org.xiaoyu.rpc.seralization.Serializer;

/**
 * Created By Have
 * 2021/7/5 13:44
 */
public enum SerializerAlgorithm {
    FASTJSON(1, new JSONSerializer()),
    KRYO(2, new KryoSerializer()),
    HESSIAN2(3, new Hessian2Serializer()),
    PROTOBUF(4, new ProtobufSerializer());

    private int type;
    private Serializer serializer;

    private SerializerAlgorithm(int type, Serializer serializer) {
        this.type = type;
        this.serializer = serializer;
    }


    public int getType() {
        return type;
    }

    public Serializer getSerializer() {
        return serializer;
    }
}
